package com.easyCode.feature.mybaits;

/**
 * @author 大忽悠
 * @create 2023/3/8 18:51
 */
public class PageContext {
    private static ThreadLocal<PageResult> PAGE_INFO=new ThreadLocal<>();

    protected static void setPageInfo(PageResult pageResult){
        PAGE_INFO.set(pageResult);
    }

    public static PageResult getPageInfo(){
        return PAGE_INFO.get();
    }

    /**
     * 请求执行完毕,清除线程本地副本
     */
    public static void clear(){
        PAGE_INFO.remove();
    }
}
